;
define(function(require, exports, module) {
	'use strict';
	var util = require("util");
	var base = require("base");
	var dialog = require("dialog");
	var router = require("../hash/pageRouter");
	var databind = require("databind");
	var css_riskWarning = require("./warningSchemeResultDetail.css");
	var html_enterprise_list = require("./html_enterprise_list.html");
	var html_memberGrade_list = require("./html_memberGrade_list.html");
	var tools = require("tools");
	var css_dialog = require("css_dialog");
	var schemeResultId;
	var tools = require("tools");
	var init = function(page) {
		schemeResultId = page.params.schemeResultId;
		initEvent();
		router.init();
	};
	
	var initEvent = function() {
		// 若未登录，则返回登陆页面
		if (base.getData("sid") == null || base.getData("sid") == ""|| base.getData("sid") == undefined) {
			top.location.href = "../login/login.html";
		}
		
		tools.loadList("inquireWarningSchemeResultDetail.json", $("#warningSchemeResultDetail .table_type"), $("#warningSchemeResultDetailTpl"), {schemeResultId: schemeResultId}, function(){
			
			//预警方案详情
			$("#warningSchemeResultDetail .schemeDetail").unbind("click").click(function(){
				router.route("auditWarning/warningSchemeCreate.html?schemeId=" + $(this).attr("schemeId"));
			});
			
			//企业详情
			$("#warningSchemeResultDetail .enterpriseDetail1").unbind("click").click(function(){
				router.route("client/clientManage_details.html?enterpriseId=" + $(this).attr("enterpriseId"));
			});
			
			//融资详情
			$("#warningSchemeResultDetail .financingDetail").unbind("click").click(function(){
				router.route("financing/financingDetailInfo.html?financeId=" + $(this).attr("financeId"));
			});
			
			//箱货详情
			$("#warningSchemeResultDetail .inventoryDetail").unbind("click").click(function(){
				router.route("bulkstockTallyDetail/bulkstockTallyDetail.html?inventoryId=" + $(this).attr("inventoryId"));
			});
			
			//物流信息
			$("#warningSchemeResultDetail .logisticsDetail").unbind("click").click(function(){
				router.route("logisticsInfo/inquireLogisticsInfoDetail.html?inventoryId=" + $(this).attr("inventoryId"));
			});
			
			//货物信息
			$("#warningSchemeResultDetail .bulkstockDetailInfo").unbind("click").click(function(){
				router.route("commodityPriceCollection/commodityPriceCollectionMonitor.html?bulkstockName=" + encodeURI(encodeURI($(this).attr("bulkstockName"))) + "&specification=" + encodeURI(encodeURI($(this).attr("specification"))));
			});
			
		});
	};
	
	return {
		init : init
	};
});